package com.bishe.demo.modules.hotel.hotelMain.dao;

import com.bishe.demo.modules.hotel.hotelMain.entity.HotelMainUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface HotelMainUserDao {
    @Insert("insert into hotel_main_user values(null,#{hotelMainId},#{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertHotelMainUser(HotelMainUser hotelMainUser);

    @Delete("delete from hotel_main_user where hotel_main_id=#{hotelId}")
    void deleteByHotelId(int hotelId);
}
